using System;
using System.Collections.Generic;
using System.Text;
using SchEdu.Framework.DataModel;
using SchEdu.Framework.Exceptions;

namespace SchEdu.Framework.Validators
{
    public class OrderReleaseDateValidator : Validator
    {
        public OrderReleaseDateValidator(SchEduData schEduData)
            : base(schEduData)
        {
        }

        #region IValidator Members

        public override void Validate()
        {
            foreach (SchEduDataSet.OrderRow order in SchEduData.Order)
            {
                if (order.IsReleaseDateNull() == true)
                {
                    throw new ValidatorException(string.Format(Resources.NoReleaseDate, order.OrderNo ));
                }
            }
        }

        #endregion
    }
}
